# 06 Dec 2008
# Function: creating a circular array of n Pt bonding pads
# Author: Lorenz Lechner

hardclear

#initialization
run values.ini
run initialization.sps

#starting dialog
dialog 0,"Move to Start Position","Confirm that the sample is centered with respect to the electron beam."

#fix stage position
getstagepos
x0=x
y0=y

#deposition step 1
setaperture aperture1
run alignment11.sps
controll = controll * error
run alignment12.sps
controll = controll * error
stagemove xy, x0, y0
if (control = 0) goto abort
run deposition1.sps

#deposition step 2
setaperture aperture2
run alignment21.sps
controll = controll * error
run alignment22.sps
controll = controll * error
stagemove xy, x0, y0
if (control = 0) goto abort
run deposition2.sps

#Bonding pads step 2
insert gisnum
setpatinfo 0.075, Pt dep
setaperture aperture2
n=0
loop:
polygon -120, 20,-50, 20,-50, -20, -120, -20
k1=patkey
polygon -50, 2.5,-15, 1,-15, -1, -50, -2.5
k2=patkey
r=60*n
setrotation r, k1
setrotation r, k2
n=n+1
if (n<6) goto loop
mill
clear

abort:

setaperture 1
retract gisnum
clear


result = controll
end: